﻿using System;
using System.Collections.Generic;

namespace Codemonk.Common.Configuring
{
    /// <summary>
    /// 配置读取器接口
    /// </summary>
    public interface IConfigReader
    {
        /// <summary>
        /// 配置文件路径
        /// </summary>
        string ConfigFile { get; set; }
        /// <summary>
        /// 读取指定xpath下的配置信息
        /// </summary>
        /// <param name="xpath">Xpath</param>
        /// <returns>配置信息</returns>
        IEnumerable<string> Read(string xpath);
        /// <summary>
        /// 是否启用文件监测
        /// </summary>
        bool EnableMonitoring { set; get; }
        /// <summary>
        /// 仅当<see cref="Enable monitoring"/>为True时，文件发生变化时，触发此事件
        /// </summary>
        event EventHandler OnFileChanged;
    }
}
